package lab01;

/**
 * Created by JAVA on 2017/9/30.
 */
import java.util.Scanner;
public class Test06 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入课程成绩,成绩范围为1到5:");
        int score = in.nextInt();
        add(score);
     /* switch(score){
            case 1:
                System.out.println("不及格");break;
            case 2:
                System.out.println("及格");break;
            case 3:
                System.out.println("中等");break;
            case 4:
                System.out.println("良好");break;
                default:
                System.out.println("优秀");break;
        }*///用switch输出成绩等级
      if(score==1){
          System.out.println("不及格");
      }else if(score==2){
          System.out.println("及格");
      }else if(score==3){
          System.out.println("中等");
      }else if(score==4){
          System.out.println("良好");
      }else {
          System.out.println("优秀");//用if else来输出1到5 的成绩等级
      }
    }
    public static void add(int a){
        switch(a){
            case 1:
                System.out.println("不及格");break;
            case 2:
                System.out.println("及格");break;
            case 3:
                System.out.println("中等");break;
            case 4:
                System.out.println("良好");break;
            default:
                System.out.println("优秀");break;
        }//用switch输出成绩等级
    }
}